<?php
$con = mysql_connect("localhost:3306","root","111111");
if (!$con) {
	die ("<br>无法连接数据库".mysql_error());
}
mysql_select_db("heavendb",$con);
//删除
$del_sql = "DELETE FROM `user` WHERE `user_name` = 'hi';";
echo "<br>".mysql_query($del_sql);
//查询
$que_sql = "SELECT * FROM `user` LIMIT 0, 1000";
$result = mysql_query($que_sql);
while ($row = mysql_fetch_array($result)) {
	echo "<br>$row[0]=>$row[1]";
}
//增加
$add_sql = "INSERT INTO `user` (`user_id`, `user_name`) VALUES ('3', '3');";
echo "<br>".mysql_query($add_sql);
//修改
$upd_sql = "UPDATE `heavendb`.`user` SET `user_name` = 'heaven' WHERE `user_id` = '3'; ";
echo "<br>".mysql_query($upd_sql);
echo "<br>数据库准备关闭...";
mysql_close();
echo "<br>数据库已经关闭...";
?>